package com.example.design.state.event.impl;

import com.example.design.state.Context;
import com.example.design.state.Transition;
import com.example.design.state.consts.StateConst;
import com.example.design.state.enums.DemandState;
import com.example.design.state.enums.EventType;
import com.example.design.state.event.Event;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 审批通过事件.
 *
 * @author duk
 * @date 2024-01-15 13:54
 */
@Slf4j
@Service(StateConst.StateService.REJECT_PASS)
public class RejectPassEvent extends Event {

    public RejectPassEvent() {
        super(EventType.AUDIT_PASS, Transition.transition(DemandState.TOBE_AUDITED, DemandState.AUDIT_REFUSE));
    }

    @Override
    public void postTransit(Context ctx) {
        log.info("拒绝审批++++");
    }
}
